﻿using Entity.Models;
using IDAL.IBase;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace IDAL
{
    /// <summary>
    /// DAL操作接口（基类）
    /// </summary>
    public interface IBaseEntity<T> where T: BaseEntity
    {
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        int AddEntity(T entity);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        int UpdataEntity(T entity);

        /// <summary>
        /// 获取数据 
        /// </summary>
        /// <returns></returns>
        DbSet<T> getEntitys();

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        int DalateEntity(string Id);
    }
}
